package cn.tedu.basic;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

//测试  客户端
public class Test11 {
    public static void main(String[] args) throws IOException {
        Socket socket =new Socket("176.8.3.117",10000);
        System.out.println("已经连接成功");
        InputStream inp =socket.getInputStream();
        for (int i = 0; i <12 ; i++) {
            int read = inp.read();
            char c = (char) read;
            System.out.print(c);
        }
        inp.close();
        OutputStream out =socket.getOutputStream();
        out.write("I love you too !".getBytes());
        out.close();


    }
}
